import lodash from 'lodash'
const tpl ={
    spanDisplay:{
        type:'spanDisplay',
    },
    text:{
        type:'text',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        prefix:'',
        suffix:'',
    },
    textCompase:{
        type:'textCompase',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        includePrepend:true,
        includeAppend:true,
        prependText:'',
        appendText:'',
    },
    textPrepend:{
        type:'textPrepend',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        includePrepend:true,
        prependText:'',
    },
    textAppend:{
        type:'textAppend',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        includeAppend:true,
        appendText:'',
    },
    textSelect:{
        type:'textSelect',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        includePrepend:false,
        includeAppend:false,
        prependWidth:50,
        appendWidth:50,
        prepend:[],
        append:[],
    },
    textarea:{
        type:'textarea',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autosize:true,
        maxlength:null,
        rows:2,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,

    },
    password:{
        type:'password',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        password:true,
        prefix:'',
        suffix:'',
    },
    check:{
        type:'check',
        required:true,
        disabled:false,
        readonly:false,
        autofocus:true,
    },
    multiCheck:{
        type:'multiCheck',
        required:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        options:[]
    },
    radio:{
        type:'radio',
        required:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        prefix:'',
        suffix:'',
        options:[]
    },
    select:{
        type:'select',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        autofocus:true,
        filterable:true,
        filterByLabel:true,
        labelInValue:true,
        allowCreate:false,
        placement:'bottom',
        prefix:'',
        options:[]
    },
    icoSelect:{
        type:'icoSelect',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        autofocus:true,
        filterable:true,
        filterByLabel:true,
        labelInValue:false,
        allowCreate:false,
        placement:'bottom',
        prefix:'',
        options:null//ico
    },
    multiSelect:{
        type:'multiSelect',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:false,
        disabled:false,
        readonly:false,
        autofocus:true,
        filterable:true,
        filterByLabel:true,
        labelInValue:false,
        allowCreate:false,
        placement:'bottom',
        prefix:'',
        options:[]
    },
    date:{
        type:'date',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    time:{
        type:'time',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    datetime:{
        type:'datetime',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    daterange:{
        type:'daterange',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    datetimerange:{
        type:'datetimerange',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    color:{
        type:'color',
        required:true,
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        editable:true,
        placement:'bottom',
    },
    switch:{
        type:'switch',
        required:true,
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        trueColor:'',
        falseColor:'',
        trueValue:true,
        falseValue:false
    },
    array:{
        type:'array',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        prefix:'',
        suffix:'',
    },
    number:{
        type:'number',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        min:0,
        max:100,
        step:1,
        precision:1,
    },
    percent:{
        type:'percent',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        min:0.0001,
        max:10,
        step:0.0001,
        precision:4,
    },
    pi:{
        type:'pi',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        maxlength:null,
        autofocus:true,
        autocomplete:'off',
        spellcheck:false,
        min:0,
        max:100,
        step:1,
        precision:1,
    },
    link:{
        type:'link',
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        disabled:false,
        prefix:'',
        suffix:'',
    },
    cascader:{
        type:'cascader',
        required:true,
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        clearable:true,
        disabled:false,
        readonly:false,
        autofocus:true,
        filterable:true,
        placement:'bottom',
        options:[]
    },
    display:{
        type:'display',
        placeholder:{
            'en-US':'',
            'zh-CN':'',
        },
        disabled:false,
        readonly:false,
    }
}
const config = {
    class:'',
    style:{},
    visible:true,
    hidden:false,
    disabled:false,
    editor:{}
}
const getEditor = (type,cfg={})=>{
    return lodash.merge({
        ...config,
        editor:tpl[type]
    },cfg)
}
const editorList = Object.keys(tpl);
export {editorList,getEditor};
// export getEditor;